home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 050 / madtrb13.arc / DOSDATE.PAS < prev    next >
Pascal/Delphi Source File  |  1980-01-01  |  961b  |  36 lines

  1. VAR  TDate : String[6];
  2.      ddate : string[8];
  3. PROCEDURE DOSDate;
  4.   TYPE
  5.     regpack = record
  6.                 ax,bx,cx,dx,bp,si,ds,es,flags: integer;
  7.               end;
  8.   VAR
  9.     recpack:       regpack;                {record for MsDos call}
  10.     month,day:     string[2];
  11.     year:          string[4];
  12.     dx,cx:         integer;
  13.   begin
  14.     with recpack do
  15.     begin
  16.       ax := $2a shl 8;
  17.     end;
  18.     MsDos(recpack);                        { call function }
  19.     with recpack do
  20.     begin
  21.       str(cx,year);                        {convert to string}
  22.       str(dx mod 256,day);                     { " }
  23.       str(dx shr 8,month);                     { " }
  24.     end;
  25.     Year:=Copy(Year,3,2);
  26.     If Length(Month) = 1 then Month:='0'+Month;
  27.     If Length(Day) = 1 then Day:='0'+Day;
  28.     Tdate := year + month + day;
  29.     ddate := month+'/'+day+'/'+year;
  30.   end;
  31.   begin
  32.   dosdate;
  33.   writeln(tdate);
  34.   writeln(ddate);
  35.   end.
  36.